fix db:seed

Andrew Cantino 12 years ago
parent
commit
3eff5bfa0c
2 changed files with 2 additions and 2 deletions
  1. 1 1
      app/models/agents/weather_agent.rb
  2. 1 1
      db/seeds.rb

+ 1 - 1
app/models/agents/weather_agent.rb

@@ -61,7 +61,7 @@ module Agents
61 61
 
62 62
     def validate_options
63 63
       errors.add(:base, "zipcode is required") unless options[:zipcode].present?
64
-      errors.add(:base, "api_key is required") unless key_setup?
64
+      errors.add(:base, "api_key is required") unless options[:api_key].present?
65 65
     end
66 66
 
67 67
     def check

+ 1 - 1
db/seeds.rb

@@ -13,7 +13,7 @@ unless user.agents.where(:name => "SF Weather Agent").exists?
13 13
   Agent.build_for_type("Agents::WeatherAgent", user,
14 14
                        :name => "SF Weather Agent",
15 15
                        :schedule => "10pm",
16
-                       :options => {:zipcode => "94103"}).save!
16
+                       :options => { :zipcode => "94103", :api_key => "your-key" }).save!
17 17
 end
18 18
 
19 19
 unless user.agents.where(:name => "XKCD Source").exists?